<?php

$commission_type = array(
    '1' => 'develop_deal',
    '2' => 'direct_deal',
    '3' => 'indirect_deal',
);

/**
 * 日志记录方法
 * @param $msg
 * @param string $level DEBUG,INFO,WARN,ERR
 * @return bool
 */
function logUtil($msg,$level="INFO"){

    $cost_mem = memory_usage();
    $log = "[{$level}][".date('Y-m-d H:i:s')."][{$cost_mem}]\t{$msg}\n";
    echo $log;
    unset($log);
}


function memory_usage() {
    $memory     = ( ! function_exists('memory_get_usage')) ? '0' : round(memory_get_usage()/1024/1024, 2).'MB';
    return $memory;
}